package cn.whdream.datastructure.search;
/**
 * 
 * @author blackjuly
 * 	顺序查找
 */
public class SeqSearch {
	public static void main(String[] args) {
		int arr[] = {1,9,11,-1,34};
		int index = seqSearch(arr,11);
		if(index == -1) {
			System.out.println("没有找到");
			return;
		}
		System.out.println("坐标："+index);
	}

	private static int seqSearch(int[] arr, int num) {
		for(int i =0;i< arr.length;i++) {
			if(arr[i] == num) {
				return i;
			}
		}
		return -1;
	}
}
